<?php
include("../inc/Function.php");

$psize = 15;
$page = isset($_GET['page'])?$_GET['page']:1;
$oid = isset($_GET['oid'])?$_GET['oid']:0;
$uid = isset($_GET['uid'])?$_GET['uid']:0;
$state = isset($_GET['state'])?$_GET['state']:5;
$cplx = isset($_GET['cplx'])?$_GET['cplx']:0;
$type = isset($_GET['type'])?$_GET['type']:0;
$code = isset($_GET['code'])?$_GET['code']:"";
$hjocode = isset($_GET['hjocode'])?$_GET['hjocode']:"";
$tname = isset($_GET['tname'])?$_GET['tname']:"";
$uname = isset($_GET['uname'])?$_GET['uname']:"";
$time = isset($_GET['time'])?$_GET['time']:"";
$gname = isset($_GET['gname'])?$_GET['gname']:"";
$ocode = isset($_GET['ocode'])?$_GET['ocode']:"";


if($_SESSION['a']['alevel']!=5){
    if($power['scdd']!=1){
        echo "<script>alert('权限不足');window.location.href='index.php';</script>";exit;
    }
}
$num = orderlistnum($uid,$state,$code,$tname,$uname,$time,$gname,$cplx,$type,$ocode,$oid,$hjocode);
$list = orderlist($page,$psize,$uid,$state,$code,$tname,$uname,$time,$gname,$cplx,$type,$ocode,$num,$oid,$hjocode);

if($list){
    $msg = 1;
}else{
    $msg = 0;
}
$page1 = page1($num,$psize,$page,$_SERVER['PHP_SELF']."?uid=$uid&state=$state&code=$code&tname=$tname&uname=$uname&time=$time&gname=$gname&cplx=$cplx&ocode=$ocode&type=$type&hjocode=$hjocode");
$tpl->assign('page1',$page1);
$tpl->assign('msg',$msg);
$tpl->assign('oid',$oid);
$tpl->assign('uid',$uid);
$tpl->assign('state',$state);
$tpl->assign('cplx',$cplx);
$tpl->assign('hjocode',$hjocode);
$tpl->assign('ocode',$ocode);
$tpl->assign('type',$type);
$tpl->assign('code',$code);
$tpl->assign('tname',$tname);
$tpl->assign('uname',$uname);
$tpl->assign('time',$time);
$tpl->assign('gname',$gname);
$tpl->assign('page',$page);
$tpl->assign('osarr1',$osarr1);
$tpl->assign('osarr2',$osarr2);
$tpl->assign('hjarr',$hjarr);
$tpl->assign('payarr',$payarr);
$tpl->assign('catarr',$catarr);
$tpl->assign('olist',$list);
$tpl->show('orderlist');
?>